package com.sz.main;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;

import com.example.gcord.gcorddemo.R;
import com.sz.adapter.DailAdapter;
import com.sz.bean.RecordInfo;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/9/27.
 */
public class DailListActivity extends Activity {

    private ListView mListView;
    private List<RecordInfo> recordInfos;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_dail);

        initData();

        mListView = (ListView) findViewById(R.id.dail_list);
        DailAdapter adapter = new DailAdapter(DailListActivity.this, recordInfos);
        mListView.setAdapter(adapter);
        adapter.notifyDataSetChanged();
    }

    private void initData() {
        recordInfos = new ArrayList<>();
        recordInfos.add(new RecordInfo("张三", "1380000000", "2016-09-27 12:15:33", 1, 1000, 1001, "气象台领导"));
        recordInfos.add(new RecordInfo("李四", "1380000000", "2016-09-27 12:15:33", 1, 1000, 1001, "气象台领导"));
        recordInfos.add(new RecordInfo("王五", "1380000000", "2016-09-27 12:15:33", 1, 1000, 1001, "气象台领导"));
        recordInfos.add(new RecordInfo("马六", "1380000000", "2016-09-27 12:15:33", 1, 1000, 1002, "科室领导"));
        recordInfos.add(new RecordInfo("赵七", "1380000000", "2016-09-27 12:15:33", 1, 1000, 1002, "科室领导"));
        recordInfos.add(new RecordInfo("刘八", "1380000000", "2016-09-27 12:15:33", 1, 1000, 1002, "科室领导"));
        recordInfos.add(new RecordInfo("王大", "1380000000", "2016-09-27 12:15:33", 1, 1000, 1002, "科室领导"));
        recordInfos.add(new RecordInfo("张三", "1380000000", "2016-09-27 12:15:33", 1, 1000, 1003, "站领导"));
        recordInfos.add(new RecordInfo("李四", "1380000000", "2016-09-27 12:15:33", 1, 1000, 1003, "站领导"));
        recordInfos.add(new RecordInfo("张柳文", "1380000000", "2016-09-27 12:15:33", 1, 1000, 1003, "站领导"));
        recordInfos.add(new RecordInfo("樊文革", "1380000000", "2016-09-27 12:15:33", 1, 1000, 1003, "站领导"));
        recordInfos.add(new RecordInfo("刘倩内", "1380000000", "2016-09-27 12:15:33", 1, 1000, 1003, "站领导"));
    }
}
